package com.lzq.messagewall.controller;

import com.lzq.messagewall.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import com.lzq.messagewall.model.MessageInfo;

@RequestMapping("/message")
@RestController
public class MessageController {
    @Autowired
    private MessageService messageService;
    @RequestMapping(value = "/publish",method = RequestMethod.POST)
    public boolean publish(@RequestBody MessageInfo messageInfo) {
        return messageService.publishService(messageInfo);
    }

    @RequestMapping("/getList")
    public List<MessageInfo> getList() {
        return messageService.getListService();
    }
}
